<?php
namespace Tbf\Util;
/**
 * @deprecated
 */
class ChangeSetUtil
{
    /**
     * 字段变化
     * 输入
     * data_new
     * data_old
     * 输出
     * data_new(不变)
     * data_old
     * change_new
     * change_old
     * action
     * 输入的其他字段都不会变
     * */
    public static function getDiff($input)
    {
        $diff = new ChangeSet\Diff($input['data_old'],$input['data_new']);
        $output = $input;
        $output['change_old'] = $diff->getChangeOld();
        $output['change_new'] = $diff->getChangeNew();
        $output['action'] = $diff->getAction();

        return $output;
    }
}
